package com.xuebusi.toutiao.test.link;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO 类描述
 *
 * @author shiyanjun
 * @version 1.0
 * @date 2021/4/23 14:10
 */
public class LinkGroup extends AbsLink {
    public LinkGroup(String linkNo, String linkCustName, String linkAmt, String linkDate, String linkEndDate, String linkGenType, String valid) {
        super(linkNo, linkCustName, linkAmt, linkDate, linkEndDate, linkGenType, valid);
    }

    @Getter
    @Setter
    private List<AbsLink> childs;

    public void add(AbsLink child) {
        if (this.childs == null) {
            this.childs = new ArrayList<>();
        }
        this.childs.add(child);
    }

    public void remove(AbsLink child) {
        this.childs.remove(child);
    }
}
